﻿<%@ page language="C#" masterpagefile="~/MasterPage.master" autoeventwireup="true" enableeventvalidation="true" inherits="UnitManage, App_Web_8ukit5sw" title="单位管理" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<ul class="box">
        <li id="submenu-active"><a href="#">单位管理</a>
        <ul>
            <li>
                <asp:LinkButton ID="lbtnUnitList" runat="server" OnClick="lbtnUnitList_Click" CausesValidation="False">单位列表</asp:LinkButton></li><li>
                <asp:LinkButton ID="lbtnAddUnit" runat="server" OnClick="lbtnAddUnit_Click" CausesValidation="False">新增单位</asp:LinkButton>  </li>
            <li>
                <asp:LinkButton ID="lbtnFindUnit" runat="server" CausesValidation="False">查找单位</asp:LinkButton> </li>
            <li>
                <asp:LinkButton ID="lbtnUpdateUnit" runat="server" OnClick="lbtnUpdateUnit_Click" CausesValidation="False">修改单位</asp:LinkButton> </li>
            <li>
                <asp:LinkButton ID="lbtnUnitUser" runat="server" CausesValidation="False" OnClick="lbtnUnitUser_Click">单位用户</asp:LinkButton> </li>
            </ul></li>
        </ul>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder2" Runat="Server">
    <asp:UpdatePanel id="UpdatePanel1" runat="server">
    
        <contenttemplate>
<!-- 单位列表 --><asp:Panel id="pnlUnitList" runat="server"><H1>单位列表</H1><asp:GridView id="gvUnitList" runat="server" OnRowUpdating="gvUnitList_RowUpdating" OnRowCancelingEdit="gvUnitList_RowCancelingEdit" OnRowEditing="gvUnitList_RowEditing" AutoGenerateColumns="False" OnRowDataBound="gvUnitList_RowDataBound" OnRowDeleting="gvUnitList_RowDeleting"><Columns>
<asp:TemplateField HeaderText="单位ID"><ItemTemplate>
 <%#   (Container.DataItemIndex+1).ToString()%> 
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="unitid" HeaderText="ID" ReadOnly="True" Visible="False">
<FooterStyle Width="1px"></FooterStyle>

<HeaderStyle Width="1px"></HeaderStyle>

<ItemStyle Width="1px"></ItemStyle>
</asp:BoundField>
<asp:BoundField DataField="unitname" HeaderText="单位名称"></asp:BoundField>
<asp:BoundField DataField="unitdistrict" HeaderText="所属区"></asp:BoundField>
<asp:BoundField DataField="unitlevel" HeaderText="级别"></asp:BoundField>
<asp:BoundField DataField="unituserid" HeaderText="联系人"></asp:BoundField>
<asp:CommandField ShowEditButton="True"></asp:CommandField>
<asp:TemplateField ShowHeader="False"><ItemTemplate>
<asp:LinkButton id="lbtnDelUnit" runat="server" Text="删除" CausesValidation="False" CommandName="Delete"></asp:LinkButton>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView> <asp:LinkButton id="lbtnAddUnit2" onclick="lbtnAddUnit_Click" runat="server">新增单位</asp:LinkButton><BR /><asp:Label id="lblMsg1" runat="server"></asp:Label></asp:Panel> <!-- 新增单位 --><asp:Panel id="pnlUnitAdd" runat="server" Width="444px"><H1>新增单位</H1><TABLE><TBODY><TR><TD>单位名称</TD><TD><asp:TextBox id="txtUnitName" runat="server"></asp:TextBox></TD><TD><asp:RequiredFieldValidator id="rfvUnitName" runat="server" ControlToValidate="txtUnitName" ErrorMessage="请输入单位名称"></asp:RequiredFieldValidator></TD></TR><TR><TD>所属区</TD><TD><asp:DropDownList id="ddlUnitDistrict" runat="server" Width="151px"><asp:ListItem>江汉区</asp:ListItem>
<asp:ListItem>江岸区</asp:ListItem>
<asp:ListItem>硚口区</asp:ListItem>
<asp:ListItem>洪山区</asp:ListItem>
<asp:ListItem>武昌区</asp:ListItem>
<asp:ListItem>青山区</asp:ListItem>
<asp:ListItem>汉阳区</asp:ListItem>
<asp:ListItem>东西湖区</asp:ListItem>
<asp:ListItem>汉南区</asp:ListItem>
<asp:ListItem>蔡甸区</asp:ListItem>
<asp:ListItem>新洲区</asp:ListItem>
<asp:ListItem>江夏区</asp:ListItem>
<asp:ListItem>黄陂区</asp:ListItem>
<asp:ListItem>其他地区</asp:ListItem>
</asp:DropDownList></TD><TD></TD></TR><TR><TD>单位级别</TD><TD><asp:RadioButtonList id="rblUnitLevel" runat="server" Width="130px"><asp:ListItem Value="1">1 市级</asp:ListItem>
<asp:ListItem Value="2">2 区级</asp:ListItem>
<asp:ListItem Value="3">3 医院级</asp:ListItem>
</asp:RadioButtonList></TD><TD>1为市级，2为区级，3为医院级</TD></TR><TR><TD>排序ID</TD><TD><asp:TextBox id="txtUnitUserid" runat="server"></asp:TextBox></TD><TD></TD></TR><TR><TD colSpan=3><asp:Button id="btnAddUnit" onclick="btnAddUnit_Click" runat="server" Text="添加"></asp:Button></TD></TR></TBODY></TABLE><asp:LinkButton id="lbtnRtnUnitList1" onclick="lbtnRtnUnitList1_Click" runat="server" CausesValidation="False">返回单位列表</asp:LinkButton> <BR /><asp:Label id="lblMsg2" runat="server"></asp:Label></asp:Panel> <!-- 修改及更新单位信息 --><asp:Panel id="pnlUnitUpdate" runat="server" Width="386px"><H1>修改及更新单位信息</H1><TABLE><TBODY><TR><TD>单位ID</TD><TD><asp:Label id="lblUnitId" runat="server"></asp:Label></TD><TD></TD></TR><TR><TD>单位名称</TD><TD><asp:TextBox id="txtUnitName2" runat="server"></asp:TextBox></TD><TD></TD></TR><TR><TD>所属区</TD><TD><asp:DropDownList id="ddlUnitDistrict2" runat="server" Width="151px"><asp:ListItem>江汉区</asp:ListItem>
<asp:ListItem>江岸区</asp:ListItem>
<asp:ListItem>硚口区</asp:ListItem>
<asp:ListItem>洪山区</asp:ListItem>
<asp:ListItem>武昌区</asp:ListItem>
<asp:ListItem>青山区</asp:ListItem>
<asp:ListItem>汉阳区</asp:ListItem>
<asp:ListItem>东西湖区</asp:ListItem>
<asp:ListItem>汉南区</asp:ListItem>
<asp:ListItem>蔡甸区</asp:ListItem>
<asp:ListItem>新洲区</asp:ListItem>
<asp:ListItem>江夏区</asp:ListItem>
<asp:ListItem>黄陂区</asp:ListItem>
<asp:ListItem>沌口开发区</asp:ListItem>
<asp:ListItem>东湖高新区</asp:ListItem>
<asp:ListItem>其他地区</asp:ListItem>
</asp:DropDownList></TD><TD></TD></TR><TR><TD>单位级别</TD><TD><asp:RadioButtonList id="rblUnitLevel2" runat="server" Width="130px"><asp:ListItem Value="1">1 市级</asp:ListItem>
<asp:ListItem Value="2">2 区级</asp:ListItem>
<asp:ListItem Value="3">3 医院级</asp:ListItem>
</asp:RadioButtonList></TD><TD></TD></TR><TR><TD>排序ID</TD><TD><asp:TextBox id="txtUnitUserid2" runat="server"></asp:TextBox></TD><TD></TD></TR><TR><TD colSpan=3><asp:Button id="btnUpdateUnit" onclick="btnUpdateUnit_Click" runat="server" Text="更新"></asp:Button></TD></TR></TBODY></TABLE><asp:LinkButton id="lbtnRtnUnitList2" onclick="lbtnRtnUnitList1_Click" runat="server" CausesValidation="False">返回单位列表</asp:LinkButton> </asp:Panel> <asp:Panel id="pnlUnitUser" runat="server"><H1>增加单位用户</H1>选择角色：<asp:DropDownList id="ddlRole" runat="server" Width="112px"></asp:DropDownList> <asp:Button id="btnView" onclick="btnView_Click" runat="server" Text="查看"></asp:Button><BR /><asp:DataList id="dlMembers" runat="server" RepeatLayout="Flow" RepeatDirection="Horizontal" RepeatColumns="6"><ItemTemplate>
<asp:CheckBox id="cbUserName" runat="server" Text='<%# Eval("username") %>'></asp:CheckBox> <asp:Label id="lblUserid" runat="server" Text='<%# Bind("userid") %>'></asp:Label>
</ItemTemplate>
</asp:DataList> <BR /><asp:Button id="btnAddToUnit" onclick="btnAddToUnit_Click" runat="server" Text="添加到单位==>"></asp:Button> <asp:DropDownList id="ddlUnit" runat="server" Width="181px"></asp:DropDownList> <asp:Button id="btnView2" onclick="btnView2_Click" runat="server" Text="查看单位用户"></asp:Button><BR /><asp:DataList id="dlUnitUser" runat="server" RepeatLayout="Flow" RepeatDirection="Horizontal" RepeatColumns="6"><ItemTemplate>
    &nbsp;<asp:CheckBox ID="cbUnitUserName" runat="server" Text='<%# Bind("username") %>' />
    <asp:Label ID="lbUnitUserId" runat="server" Text='<%# Bind("userid") %>'></asp:Label>
</ItemTemplate>
</asp:DataList><br />
    <asp:Button ID="btnMoveOutUser" runat="server" Enabled="False" OnClick="btnMoveOutUser_Click"
        Text="移除用户" /></asp:Panel> 
</contenttemplate>
    </asp:UpdatePanel>
</asp:Content>
